<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/common.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <ui:define name="title">
        Search result
    </ui:define>

    <ui:define name="head">
        <script src="../../res/js/jquery-1.10.2.min.js"></script>
        <script src="../../res/js/jquery-ui-1.10.0.custom.js"></script>
          <link rel="stylesheet" href="../../res/css/admin-style.css"/>
        <style>
            .page-header{
                margin-top: 30px;
            }
        </style>
    </ui:define>

    <ui:define name="pageheader">
        Search result    
    </ui:define>

    <ui:define name="content">
        <h:form id="mainform">
            <h:panelGroup rendered="#{adminSearch.mode ==1 || adminSearch.mode==0}">
                <h3 class="page-header">Students found</h3>
                <ui:repeat value="#{adminSearch.listStudent}" var="s" >
                    <h:commandLink action="#{studentManager.viewDetail(s)}" >
                        <div>
                            <p>
                                FullName:
                            </p>#{s.accounts.fullName}
                        </div>
                    </h:commandLink>
                </ui:repeat>
            </h:panelGroup>
            <h:panelGroup rendered="#{adminSearch.mode ==2 || adminSearch.mode==0}">
                <h3 class="page-header">Staffs found</h3>
                <ui:repeat value="#{adminSearch.listStaffs}" var="s" >
                    <h:commandLink action="#{staffManager.viewDetail(s)}" >
                        <div>
                            <p>
                                FullName:
                            </p>#{s.accounts.fullName}
                        </div>
                    </h:commandLink>
                </ui:repeat>
            </h:panelGroup>
            <h:panelGroup rendered="#{adminSearch.mode ==3 || adminSearch.mode==0}">
                <h3 class="page-header">Courses found</h3>
                <ui:repeat value="#{adminSearch.listStaffs}" var="s" >
                    <h:commandLink action="#{staffManager.viewDetail(s)}" >
                        <div>
                            <p>
                                FullName:
                            </p>#{s.accounts.fullName}
                        </div>
                    </h:commandLink>
                </ui:repeat>
            </h:panelGroup>
            <h:panelGroup rendered="#{adminSearch.mode ==4 || adminSearch.mode==0}">
                <h3 class="page-header">Events found</h3>
                <ui:repeat value="#{adminSearch.listStaffs}" var="s" >
                    <h:commandLink action="#{staffManager.viewDetail(s)}" >
                        <div>
                            <p>
                                FullName:
                            </p>#{s.accounts.fullName}
                        </div>
                    </h:commandLink>
                </ui:repeat>
            </h:panelGroup>

        </h:form>

    </ui:define>

</ui:composition>
